#pragma once

#include <ECS/ECS.h>
#include "Transform.h"

class MapData;

struct MapObstacleDef
{
	mtMETA_DEC;
};

class MapObstacle : public ECS::Component
{
	mtMETA_DEC;
public:
	MapObstacle();
	~MapObstacle();
	bool initWith(MapObstacleDef* def);

	void onStart();
protected:
	virtual void onEnabled(bool enabled) override;
	virtual void onDestroyed() override;
	void onSetTransform(const ECS::Vec2<float>& pos, float ang);

	ECS::Vec2<int> _position;
	int _rotation; // [0..7] 45 degree
	TransformClient* _tClient;
	MapData* _map;
};